package sctu.edu.java.year2016.team03.zhaoyong.day20160522.chapter5_3;

/**
 * 创建二维数组arr[]，将二维数组全部元素的和输出。
 * Created by zhaoyong on 2016/5/23.
 */
public class noon {
    public static void main(String[] args) {
        int[][] arr = {{4, 5, 2}, {3, 1, 7}};
        int a = 0;
        for (int i = 0; i < arr.length; i++) {
            for (int j = 0; j <= arr.length; j++)
                a = a + arr[i][j];
        }
        System.out.println("数组的和为：" + a);
    }
}
